<template>
  <div class="stage-list">
    <div
      v-for="(item, index) in dataList"
      :key="index"
      class="stage-item"
    >
      <div class="stage-header">
        <div class="circle-container">
          <div class="outer-circle active">
            <div class="inner-circle active"></div>
          </div>
        </div>
        <div class="stage-name">{{ item.nodeStage }}</div>
      </div>

      <div class="stage-detail">
        <div
          class="stage-detail-time"
          v-if="item.nodeStage !== '竣工验收'"
        >
          <span>计划开始时间：</span>
          <span class="time-text">{{
            item.planStartTime || '-'
          }}</span>
        </div>
        <div
          class="stage-detail-time"
          v-if="item.nodeStage !== '竣工验收'"
        >
          <span>预计完成时间：</span>
          <span class="time-text">{{
            item.planEndTime || '-'
          }}</span>
        </div>
        <div class="stage-detail-time">
          <span>实际完成时间：</span>
          <span class="time-text">{{
            item.actuallyTime || '-'
          }}</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  name: 'StageList',
  props: {
    stageList: {
      type: Array,
      required: true
    }
  },
  data() {
    return {
      dataList: []
    }
  },
  watch: {
    stageList(val) {
      this.dataList = val
    }
  }
}
</script>

<style scoped>
.stage-list {
  /* border: 1px solid #e4e7ed; */
  border-radius: 6px;
  padding: 0 10px;
}
.stage-item {
  /* border-bottom: 1px solid #ebeef5; */
  border-top: 1px solid #e0e2e5;
  padding: 10px 0;
}
.stage-header {
  display: flex;
  align-items: center;
}
.circle-container {
  margin-right: 10px;
}
.outer-circle {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1px solid #dcdfe6;
  display: flex;
  align-items: center;
  justify-content: center;
}
.outer-circle.active {
  /* border-color: rgba(0, 186, 255, 0.8); */
  background-color: rgba(0, 186, 255, 0.2);
}
.inner-circle {
  width: 10px;
  height: 10px;
  background-color: #dcdfe6;
  border-radius: 50%;
}
.inner-circle.active {
  background-color: rgba(0, 186, 255, 0.8);
}
.stage-name {
  flex: 1;
  color: #303133;
}
.stage-detail-time {
  margin: 10px 0;
}
.stage-detail-time span {
  font-size: 14px;
  color: #606061;
}
.time-text {
  margin-left: 8px;
  color: #303133;
}
</style>
